package LopCoBan;
import java.util.ArrayList; 
import java.util.Date;

public class HDNhap {

    private String MaHDNhap;

    private Date NgayXuatHD;

    private Date NgayNhapHang;

    private NV_QL_Nhap mNV_QL_Nhap;

    private ArrayList<ChiTietHDN> mChiTietHDN;

    private NhaCungCap mNhaCungCap;

    public HDNhap () {
    }

    public String getMaHDNhap () {
        return MaHDNhap;
    }

    public void setMaHDNhap (String val) {
        this.MaHDNhap = val;
    }

    public Date getNgayNhapHang () {
        return NgayNhapHang;
    }

    public void setNgayNhapHang (Date val) {
        this.NgayNhapHang = val;
    }

    public Date getNgayXuatHD () {
        return NgayXuatHD;
    }

    public void setNgayXuatHD (Date val) {
        this.NgayXuatHD = val;
    }

    public ArrayList<ChiTietHDN> getChiTietHDN () {
        return mChiTietHDN;
    }

    public void setChiTietHDN (ArrayList<ChiTietHDN> val) {
        this.mChiTietHDN = val;
    }
    
    public boolean addChiTietHDN(ChiTietHDN val)
    {
    	for(ChiTietHDN ct:mChiTietHDN)
    	{
    		if(val.equals(ct))
    			return false;
    	}
    	mChiTietHDN.add(val);
    	return true;
    }

    public NV_QL_Nhap getNV_QL_Nhap () {
        return mNV_QL_Nhap;
    }

    public void setNV_QL_Nhap (NV_QL_Nhap val) {
        this.mNV_QL_Nhap = val;
    }

    public void setNhaCungCap (NhaCungCap val) {
        mNhaCungCap = val;
    }

    public NhaCungCap getNhaCungCap () {
        return mNhaCungCap;
    }
    
    public int TinhTien()
    {
    	int sum = 0;
    	for(ChiTietHDN ct: mChiTietHDN)
    		sum += ct.getSoLuong()*ct.getDonGiaN();
    	return sum;
    }
}

